package ua.kharkov.khpi.tarasenko.bach.dao.core.order;

import java.util.ArrayList;

import ua.kharkov.khpi.tarasenko.bach.core.db.EShopDataStoreException;

/**
 * Interface for DAO for working with datasource with user's orders.
 * 
 * @author oleksandr
 * 
 */
public interface OrderUserDAO {

	/**
	 * Creates new order in DB.
	 * 
	 * @param orderUserDTO
	 *            - order to create.
	 * @throws EShopDataStoreException
	 *             if error occurred.
	 */
	public int addOrder(OrderUserDTO orderUserDTO)
			throws EShopDataStoreException;

	/**
	 * Finds all orders by specified user.
	 * 
	 * @param orderId
	 *            - user's id.
	 * @return list of user's orders.
	 * @throws EShopDataStoreException
	 *             if error occurred.
	 */
	public ArrayList<OrderUserDTO> findOrdersByUserId(int orderId)
			throws EShopDataStoreException;

	/**
	 * Updates general order's info.
	 * 
	 * @param orderUserDTO
	 *            - order to update. Order's id and user's id should be
	 *            specified.
	 * @return number of updated rows.
	 * @throws EShopDataStoreException
	 *             if error occurred.
	 */
	public int updateOrderUserStatus(OrderUserDTO orderUserDTO)
			throws EShopDataStoreException;

	public ArrayList<OrderUserDTO> findAllOrders()
			throws EShopDataStoreException;

	public ArrayList<Integer> findAllOrdersIds()
			throws EShopDataStoreException;

	public OrderUserDTO findOrderById(int orderId)
			throws EShopDataStoreException;
}
